#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@author: lyndon
@time Created on 2018/10/9 17:46
@desc
"""


def Str_StartEnd_MkString(originStr, startWithStr, endWithStr):
    return startWithStr + originStr + endWithStr


def Str_Bracket_MkString(originStr, bracketsStr):
    return Str_StartEnd_MkString(originStr, bracketsStr, bracketsStr)


def Collect_StartEnd_MkString(collection, startWithStr, endWithStr, splitFlag=""):
    collLen = len(collection)
    if collLen == 1:
        return startWithStr + collection[0] + endWithStr
    else:
        collection = map(lambda x: startWithStr + x + endWithStr, collection)
        return splitFlag.join(collection)


def Collect_Bracket_MkString(collection, bracketsStr, splitFlag):
    return Collect_StartEnd_MkString(collection, bracketsStr, bracketsStr, splitFlag)





a1 = "a"
print(Str_Bracket_MkString(a1, "'"))

print(Str_StartEnd_MkString(a1, "(", ")"))


arr1 = ["a", "b", "c"]
print("Collect_Bracket_MkString:", Collect_Bracket_MkString(arr1, "'", ","))

print("Collect_StartEnd_MkString:", Collect_StartEnd_MkString(arr1, "(", ")", ","))

arr2 = ["a"]
print(Collect_Bracket_MkString(arr2, "'", ","))

print(Collect_StartEnd_MkString(arr2, "(", ")", ","))
